namespace CSharpPro._1106;

using System;
using System.Collections.Generic;


public class Demo
{
    public void TestPrint()
    {
        IUserService userService = new UserService();
        
        List<User> testUsers = new List<User>
        {
            new User("test1", "Test123"),
            new User("test2", "Test456"),
            new User("test3", "Test789")
        };


        Console.WriteLine("所有测试用户:");
        foreach (var user in testUsers)
        {
            Console.WriteLine($"用户名: {user.Username}, 密码: {user.Password}");
        }
        
        for (int i = testUsers.Count - 1; i >= 0; i--)
        {
            if (testUsers[i].Username == "test2")
            {
                testUsers.RemoveAt(i);
                Console.WriteLine("\n已删除用户: test2");
            }
        }
        
        Console.WriteLine("\n删除后的用户列表:");
        foreach (var user in testUsers)
        {
            Console.WriteLine($"用户名: {user.Username}");
        }
        
        Console.WriteLine("\n启动用户系统...");
        userService.ShowMainMenu();
    }
}